package org.qqcui.designpattern.patterns.mediator;

/**
 * desc
 *
 * @author cuiqingqiang
 * @version 1.0
 * @date 2022/5/6 17:24
 **/
public class TV extends Colleague {
    public TV(Mediator mediator, String name) {
        super(mediator, name);
        mediator.registerColleague(name, this);
    }

    @Override
    public void sendMessage(int stateChange) {
        getMediator().getMessage(stateChange, getName());
    }

    public void startTV() {
        System.out.println("TV is starting");
    }

    public void stopTV() {
        System.out.println("TV was stopped");
    }
}
